#ifndef FRAKOUTVERSION_H
#define FRAKOUTVERSION_H

#include <QDataStream>

/**
  * An enum style class for storing information relating to the FrakOut! version.
  * @author cjr
  */
class FrakOutVersion
{

public:

    /**
     * Creates an object corresponding a null FrakOut! version.
     * @return A pointer to a version object.
     */
    static const FrakOutVersion* const Null();

    /**
     * Creates an object corresponding to FrakOut! version 1.0.0.
     * @return A pointer to a version object.
     */
    static const FrakOutVersion* const V1_0_0();

    /**
     * Creates an object corresponding to FrakOut! version 1.1.0.
     * @return A pointer to a version object.
     */
    static const FrakOutVersion* const V1_1_0();

    /**
     * Returns the version of Qt used for reading and writing objects.
     * @return A Qt version number.
     */
    QDataStream::Version qtVersion() const;

    /**
     * Returns the FrakOutVersion object corresponding to the given version number.
     * @param versionNumber The version number being sought.
     * @return An object corresponding to the given version number.
     */
    static const FrakOutVersion* const version(unsigned int versionNumber);

    /**
     * Returns a FrakOut! version number.
     * @return The version number.
     */
    unsigned int versionNumber() const;

    /**
     * Returns the FrakOut! version number as a string.
     * @return The version number as a string.
     */
    const QString versionString() const;

private:

    /**
      * Create a new FrakOutVersion object.
      * @param qtVersion The version of Qt used for reading and writing the object stream.
      * @param versionNumber The FrakOut! version number, coded as a hexadecimal number.
      * @param versionString A string version of 'versionNumber'.
      */
    FrakOutVersion(QDataStream::Version qtVersion, unsigned int versionNumber, const QString& versionString);

    /**
      * Prevent copy construction.
      */
    FrakOutVersion(const FrakOutVersion&);

    /**
      * Prevent assignment.
      */
    FrakOutVersion& operator=(const FrakOutVersion&);

private:

    /** The Qt data verson number. */
    QDataStream::Version m_qtVersion;

    /** The FrakOut! version number. */
    unsigned int m_versionNumber;

    /** A string representing the version number. */
    QString m_versionString;
};

#endif // FRAKOUTVERSION_H
